gsk: Make GskRenderer.render() drawing context-agnostic
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 24 Aug 2016 15:21:50 +0000 (16:21 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 18 Oct 2016 10:49:15 +0000 (11:49 +0100)
commit6b3c0052fcc0d837ce31a8a14d097cfa0c7a0385
treeb6e74d41450dec363c071147ffcfd0f0bf7e38df
parent13f7f5bdfca2158648b3650b30ac811f48ec6662
gsk: Make GskRenderer.render() drawing context-agnostic

We're going to need to allow rendering on a specific cairo_t in order to
implement fallback code paths inside GTK; this means that there will be
times when we have a transient GskRenderer instance that does not have a
GdkDrawingContext to draw on.

Instead of adding a new render() implementation for those cases and then
decide which one to use, we can remove the drawing context argument from
the virtual function itself, and allow using a NULL GdkDrawingContext
when calling gsk_renderer_render(). A later commit will add a generic
function to create a transient GskRenderer with a cairo_t attached to
it.

Renderers inside GSK will have to check whether we have access to a
GdkDrawingContext, in which case we're going to use it; or if we have
access to a cairo_t and a window.
gsk/gskcairorenderer.c
gsk/gskglrenderer.c
gsk/gskrenderer.c
gsk/gskrendererprivate.h